<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../layui/layui/dist/css/layui.css" />
	</head>

	<body>
		<!-- 选择人  -->
		<div class="layui-input-block" style="margin-left: 10px;color:#666666;" id="customerList">
			<input type="checkbox" name="travel_users[11]" value="11" lay-skin="primary" title="李进10" data-department="办公室" id="customer11" lay-filter="customer" value="李进10">李进10
			<input type="checkbox" name="travel_users[12]" value="12" lay-skin="primary" title="李进11" data-department="办公室" id="customer12" lay-filter="customer" value="李进11">李进11
			<input type="checkbox" name="travel_users[12]" value="12" lay-skin="primary" title="李进12" data-department="办公室" id="customer13" lay-filter="customer" value="李进12">李进12
		</div>

		<!-- 已选出行人 -->
		<div id="traveler3All">
			<div class="layui-inline customer12" data-value="customer12" style="margin-right: 0px;">
				<a class="layui-btn layui-btn-primary">李进11(办公室)</a>
			</div>
			<div class="layui-inline customer12" data-value="customer13" style="margin-right: 0px;">
				<a class="layui-btn layui-btn-primary">李进12(办公室)</a>
			</div>
		</div>
		
		
		<script src="../../layui/layui/dist/layui.js"></script>
		<script>
			layui.use(['form','jquery'],function(){
				
				var form = layui.form
					,$ = layui.jquery;
				
				// 选择人
				var customerListInput = $("#customerList input");
				var id_array=new Array();  
				$.each(customerListInput, function(index,item) {
					id_array.push(item.id);//向数组中添加元素  
				});
				
				// 已选出行人
				var traveler3All = $("#traveler3All div");
				var id_array2=new Array();  
				$.each(traveler3All, function(index,item) {
					
					var itemValue = $(item).data('value');
					var result = $.inArray(itemValue,id_array);
					if(result != -1){
						$("#"+itemValue+"").prop("checked", true); 
					}
				});
			
			
			});
			

		</script>
	</body>

</html>